[ Tried to commit wrong file last time ]
authorOwen Taylor <otaylor@redhat.com>
Thu, 21 Jan 1999 21:09:03 +0000 (21:09 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Thu, 21 Jan 1999 21:09:03 +0000 (21:09 +0000)
Thu Jan 21 16:03:02 1999  Owen Taylor  <otaylor@redhat.com>

* gtk/gtktreeitem.c: Add a paint routine, fix up bugs
in drawing where if the expose area was contained
completely in the right side of the tree the background
wasn't redraw, etc.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtktreeitem.c

index a573395553abb6f971ecbd9d50145ff6ffb80569..521055bb6d39cb440cffe626fc1ce4f31bb9f239 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+Thu Jan 21 16:03:02 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkbutton.c (gtk_button_expose): Code cleanup.
+
+       * gtk/gtktreeitem.c: Add a paint routine, fix up bugs
+       in drawing where if the expose area was contained
+       completely in the right side of the tree the background
+       wasn't redraw, etc.
+
+       * gtk/gtkwidget.c (gtk_widget_clip_rect): Fix a bug
+       in clipping draw regions while propagating them
+       upwards.
+
 Thu Jan 21 12:20:51 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkcolorsel.c (gtk_color_selection_dialog_new): 
index a573395553abb6f971ecbd9d50145ff6ffb80569..521055bb6d39cb440cffe626fc1ce4f31bb9f239 100644 (file)
@@ -1,3 +1,16 @@
+Thu Jan 21 16:03:02 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkbutton.c (gtk_button_expose): Code cleanup.
+
+       * gtk/gtktreeitem.c: Add a paint routine, fix up bugs
+       in drawing where if the expose area was contained
+       completely in the right side of the tree the background
+       wasn't redraw, etc.
+
+       * gtk/gtkwidget.c (gtk_widget_clip_rect): Fix a bug
+       in clipping draw regions while propagating them
+       upwards.
+
 Thu Jan 21 12:20:51 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkcolorsel.c (gtk_color_selection_dialog_new): 
index a573395553abb6f971ecbd9d50145ff6ffb80569..521055bb6d39cb440cffe626fc1ce4f31bb9f239 100644 (file)
@@ -1,3 +1,16 @@
+Thu Jan 21 16:03:02 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkbutton.c (gtk_button_expose): Code cleanup.
+
+       * gtk/gtktreeitem.c: Add a paint routine, fix up bugs
+       in drawing where if the expose area was contained
+       completely in the right side of the tree the background
+       wasn't redraw, etc.
+
+       * gtk/gtkwidget.c (gtk_widget_clip_rect): Fix a bug
+       in clipping draw regions while propagating them
+       upwards.
+
 Thu Jan 21 12:20:51 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkcolorsel.c (gtk_color_selection_dialog_new): 
index a573395553abb6f971ecbd9d50145ff6ffb80569..521055bb6d39cb440cffe626fc1ce4f31bb9f239 100644 (file)
@@ -1,3 +1,16 @@
+Thu Jan 21 16:03:02 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkbutton.c (gtk_button_expose): Code cleanup.
+
+       * gtk/gtktreeitem.c: Add a paint routine, fix up bugs
+       in drawing where if the expose area was contained
+       completely in the right side of the tree the background
+       wasn't redraw, etc.
+
+       * gtk/gtkwidget.c (gtk_widget_clip_rect): Fix a bug
+       in clipping draw regions while propagating them
+       upwards.
+
 Thu Jan 21 12:20:51 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkcolorsel.c (gtk_color_selection_dialog_new): 
index a573395553abb6f971ecbd9d50145ff6ffb80569..521055bb6d39cb440cffe626fc1ce4f31bb9f239 100644 (file)
@@ -1,3 +1,16 @@
+Thu Jan 21 16:03:02 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkbutton.c (gtk_button_expose): Code cleanup.
+
+       * gtk/gtktreeitem.c: Add a paint routine, fix up bugs
+       in drawing where if the expose area was contained
+       completely in the right side of the tree the background
+       wasn't redraw, etc.
+
+       * gtk/gtkwidget.c (gtk_widget_clip_rect): Fix a bug
+       in clipping draw regions while propagating them
+       upwards.
+
 Thu Jan 21 12:20:51 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkcolorsel.c (gtk_color_selection_dialog_new): 
index a573395553abb6f971ecbd9d50145ff6ffb80569..521055bb6d39cb440cffe626fc1ce4f31bb9f239 100644 (file)
@@ -1,3 +1,16 @@
+Thu Jan 21 16:03:02 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkbutton.c (gtk_button_expose): Code cleanup.
+
+       * gtk/gtktreeitem.c: Add a paint routine, fix up bugs
+       in drawing where if the expose area was contained
+       completely in the right side of the tree the background
+       wasn't redraw, etc.
+
+       * gtk/gtkwidget.c (gtk_widget_clip_rect): Fix a bug
+       in clipping draw regions while propagating them
+       upwards.
+
 Thu Jan 21 12:20:51 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkcolorsel.c (gtk_color_selection_dialog_new): 
index a573395553abb6f971ecbd9d50145ff6ffb80569..521055bb6d39cb440cffe626fc1ce4f31bb9f239 100644 (file)
@@ -1,3 +1,16 @@
+Thu Jan 21 16:03:02 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkbutton.c (gtk_button_expose): Code cleanup.
+
+       * gtk/gtktreeitem.c: Add a paint routine, fix up bugs
+       in drawing where if the expose area was contained
+       completely in the right side of the tree the background
+       wasn't redraw, etc.
+
+       * gtk/gtkwidget.c (gtk_widget_clip_rect): Fix a bug
+       in clipping draw regions while propagating them
+       upwards.
+
 Thu Jan 21 12:20:51 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkcolorsel.c (gtk_color_selection_dialog_new): 
index 1d6d44c2b087e1ba3f2a3a52f349d1ef1d6ffd8d..4ac5c362fd4c6fb0a3e25866bab3c369360b56d7 100644 (file)
@@ -59,6 +59,8 @@ static void gtk_tree_item_size_allocate (GtkWidget        *widget,
 static void gtk_tree_item_draw          (GtkWidget        *widget,
                                         GdkRectangle     *area);
 static void gtk_tree_item_draw_focus    (GtkWidget        *widget);
+static void gtk_tree_item_paint         (GtkWidget        *widget,
+                                        GdkRectangle     *area);
 static gint gtk_tree_item_button_press  (GtkWidget        *widget,
                                         GdkEventButton   *event);
 static gint gtk_tree_item_expose        (GtkWidget        *widget,
@@ -625,8 +627,8 @@ gtk_tree_item_draw_lines (GtkWidget *widget)
 }
 
 static void
-gtk_tree_item_draw (GtkWidget    *widget,
-                   GdkRectangle *area)
+gtk_tree_item_paint (GtkWidget    *widget,
+                    GdkRectangle *area)
 {
   GtkBin *bin;
   GdkRectangle child_area, item_area;
@@ -641,6 +643,25 @@ gtk_tree_item_draw (GtkWidget    *widget,
       bin = GTK_BIN (widget);
       tree_item = GTK_TREE_ITEM(widget);
 
+      if (widget->state == GTK_STATE_NORMAL)
+       {
+         gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
+         gdk_window_clear_area (widget->window, area->x, area->y, area->width, area->height);
+       }
+      else 
+       {
+         if (!GTK_WIDGET_IS_SENSITIVE (widget)) 
+           gtk_paint_flat_box(widget->style, widget->window,
+                              widget->state, GTK_STATE_INSENSITIVE,
+                              area, widget, "treeitem",
+                              0, 0, -1, -1);
+         else
+           gtk_paint_flat_box(widget->style, widget->window,
+                              widget->state, GTK_SHADOW_ETCHED_OUT,
+                              area, widget, "treeitem",
+                              0, 0, -1, -1);
+       }
+
       /* draw left size of tree item */
       item_area.x = 0;
       item_area.y = 0;
@@ -648,43 +669,17 @@ gtk_tree_item_draw (GtkWidget    *widget,
                         GTK_TREE (widget->parent)->current_indent + 2);
       item_area.height = widget->allocation.height;
 
+
       if (gdk_rectangle_intersect(&item_area, area, &child_area)) 
        {
-         if (widget->state == GTK_STATE_NORMAL)
-           {
-             gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
-             gdk_window_clear_area (widget->window, area->x, area->y, area->width, area->height);
-           }
-         else 
-           {
-             if (!GTK_WIDGET_IS_SENSITIVE (widget)) 
-               gtk_paint_flat_box(widget->style, widget->window,
-                                  widget->state, GTK_STATE_INSENSITIVE,
-                                  area, widget, "treeitem",
-                                  0, 0, -1, -1);
-             else
-               gtk_paint_flat_box(widget->style, widget->window,
-                                  widget->state, GTK_SHADOW_ETCHED_OUT,
-                                  area, widget, "treeitem",
-                                  0, 0, -1, -1);
-           }
-
-         gtk_tree_item_draw_lines(widget);
          
+         gtk_tree_item_draw_lines(widget);
+
          if (tree_item->pixmaps_box && 
              GTK_WIDGET_VISIBLE(tree_item->pixmaps_box) &&
              gtk_widget_intersect (tree_item->pixmaps_box, area, &child_area))
            gtk_widget_draw (tree_item->pixmaps_box, &child_area);
        }
-      
-      /* draw right side */
-      if (gtk_widget_intersect (bin->child, area, &child_area)) 
-       {
-         if (bin->child && 
-             GTK_WIDGET_VISIBLE(bin->child) &&
-             gtk_widget_intersect (bin->child, area, &child_area))
-           gtk_widget_draw (bin->child, &child_area);
-       }
 
       if (GTK_WIDGET_HAS_FOCUS (widget))
        gtk_paint_focus (widget->style, widget->window,
@@ -696,6 +691,30 @@ gtk_tree_item_draw (GtkWidget    *widget,
     }
 }
 
+static void
+gtk_tree_item_draw (GtkWidget    *widget,
+                   GdkRectangle *area)
+{
+  GtkBin *bin;
+  GdkRectangle child_area;
+
+  g_return_if_fail (widget != NULL);
+  g_return_if_fail (GTK_IS_TREE_ITEM (widget));
+  g_return_if_fail (area != NULL);
+
+  if (GTK_WIDGET_DRAWABLE (widget))
+    {
+      bin = GTK_BIN (widget);
+
+      gtk_tree_item_paint (widget, area);
+     
+      if (bin->child && 
+         gtk_widget_intersect (bin->child, area, &child_area))
+       gtk_widget_draw (bin->child, &child_area);
+
+    }
+}
+
 static void
 gtk_tree_item_draw_focus (GtkWidget *widget)
 {
@@ -726,12 +745,24 @@ static gint
 gtk_tree_item_expose (GtkWidget      *widget,
                      GdkEventExpose *event)
 {
+  GdkEventExpose child_event;
+  GtkBin *bin;
+
   g_return_val_if_fail (widget != NULL, FALSE);
   g_return_val_if_fail (GTK_IS_TREE_ITEM (widget), FALSE);
   g_return_val_if_fail (event != NULL, FALSE);
 
   if (GTK_WIDGET_DRAWABLE (widget))
-    gtk_tree_item_draw(widget, &event->area);
+    {
+      bin = GTK_BIN (widget);
+      
+      gtk_tree_item_paint (widget, &event->area);
+
+      child_event = *event;
+      if (bin->child && GTK_WIDGET_NO_WINDOW (bin->child) &&
+         gtk_widget_intersect (bin->child, &event->area, &child_event.area))
+       gtk_widget_event (bin->child, (GdkEvent*) &child_event);
+   }
 
   return FALSE;
 }